<template>
  <van-rate
    v-model="value"
    :size="25"
    color="#ffd21e"
    void-icon="star"
    void-color="#eee"
    @change="onChange"
  />
</template>

<script>
export default {
  data() {
    return {
        value: 1,
    };
  },
  methods: {
    onChange(value) {
      this.value = value;
      localStorage.setItem("value", JSON.stringify(this.value));
    },
  },
  mounted() {
    this.value = JSON.parse(localStorage.getItem("value"));
  },
};
</script>

<style>
</style>